package cn.xiuxius.askbox.pojo.dto.add;

import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * <p>
 * 
 * </p>
 *
 * @author xiaoxiu
 * @since 2024-07-20
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="UserAddDTO对象", description="")
public class UserAddDTO implements Serializable {

    @Pattern(regexp = "^[A-Za-z0-9]{6,16}$",message = "用户名不符合规范")
    @NotBlank(message = "用户名不能为空")
    private String username;

    @Pattern(regexp = "^[A-Za-z0-9]{6,32}$",message = "密码不符合规范")
    @NotBlank(message = "密码不能为空")
    private String password;

    private String displayName;

    private String avatar;

    private String phone;

    @NotBlank(message = "邮箱不能为空")
    @Email(message = "邮箱格式错误")
    private String email;

}
